@extends('admin.layouts.master')

@section('content')

<div class="row aw-list">
	<div class="col-lg-12">
		<section class="panel aw-content">
			<header class="panel-heading" v-if="info">
				会员详情&nbsp;
				<a class="btn btn-gules btn-xs" v-on:click="Info_Status(info.id,2,'禁用',info.nickname)" v-if="info.status==1">
					<i class="icon-eye-close"></i> 禁用
				</a>
				<a class="btn btn-green btn-xs" v-on:click="Info_Status(info.id,1,'启用',info.nickname)" v-if="info.status==2">
					<i class="icon-eye-open"></i> 启用
				</a>
				
				<!--<button class="btn btn-gules btn-xs" v-on:click="List_Status(list.id,2,'禁用')" v-if="list.status==1">
					<i class="icon-eye-close"></i> 禁用
				</button>
				<button class="btn btn-green btn-xs" v-on:click="List_Status(list.id,1,'启用')" v-if="list.status==2">
					<i class="icon-eye-open"></i> 启用
				</button>-->
			</header>
			<div class="form-group overflow-hidden"></div>
			<div class="form-group overflow-hidden" v-if="info">
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">ID：@{{info.id}}</div>
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">昵称：@{{info.nickname}}</div>
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">手机号：@{{info.phone}}</div>
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">会员等级：@{{info.vip}}</div>
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">会员积分：@{{info.integral}}</div>
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">订场次数：@{{info.num_booking}}</div>
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">取消次数：@{{info.num_cancel}}</div>
				<div class="col-sm-6 col-md-4 col-lg-3 aw-ptb10">注册时间：@{{info.reg_time}}</div>
				<div class="col-sm-12 aw-ptb10 overflow-hidden">
					所属队伍：<span v-for="(list, key) in info_team_list">@{{list.name}},</span>
				</div>
			</div>
			<header class="panel-heading">消费积分记录</header>
			<table class="table table-striped dataTable table-hover">
				<thead>
					<tr>
						<th>订单编号</th>
						<th>比赛时间</th>
						<th>支付金额</th>
						<th>积分</th>
					</tr>
				</thead>
				<tbody>
					<tr v-for="(list, key) in lists" :data-key="key" :data-id="list.id">
						<td>@{{list.order_id}}</td>
						<td>@{{list.dateline}}</td>
						<td>@{{list.money}}</td>
						<td>@{{list.integral}}</td>
					</tr>
				</tbody>
			</table>
			<div class="aw-text-center aw-list-null" v-if="lists.length==0">暂无数据</div>
			<vue-page :page_item="page_item" :page_this="page_this" :page_all="page_all" :Call_back="Call_back"></vue-page>
		</section>
	</div>
</div>

@section('pagejs')
@parent

<script type="text/javascript" src="/admin/js/vue-page.js"></script>
<script type="text/javascript" src="/admin/js/page.js"></script>
<script type="text/javascript">
var MJS_URLArry=URLArry;
var AD_list={
	api:'/adminapi/user/integral-list',
	form_data:MJS_URLArry,
	tips:false,
}
var AD_info={
	api:'/adminapi/user/user-info',
	form_data:MJS_URLArry,
	tips:false,
}
var Ajax_Vue_Fun_List=function(vue_data_list){
	var Data_Vue=ajax_data_res(vue_data_list)
	Data_Vue.info={};
	vm=new Vue({
		el:'#Vue-Body',
		data:Data_Vue,
		components:{
			'vue-page':Vpage
		},methods:{
			Call_back:function(page){
				Vm_Call_back_Page(page)
			},Info_Status:function(id,status,tips,name){
				console.log(123)
				var AD_status={
					api:'/adminapi/user/user-status',
					form_data:{id:id,status:status},
					tips:tips+'用户 ['+name+'] 成功',
					msg:'是否'+tips+' ['+name+'] 该用户？',
				}
				postData(AD_status,function(){
					getData(AD_info,function(status_info){
						console.log(status_info)
						vm.info=status_info;
					})
				})
			}
		}
	})
	getData(AD_info,Ajax_Vue_Fun_Info)
}
var Ajax_Vue_Fun_Info=function(vue_data_info){
	vm.info=vue_data_info;
	vm.info_team_list=vue_data_info.team_list.list;
}
if(MJS_URLArry.id>0){
	getData(AD_list,Ajax_Vue_Fun_List)
}else{
	location.href='/admin/user/list?page_id=4';
}
</script>
@endsection

@endsection

